@using MvcDemo02.Models
@model Student

<div>
    <table>
        @if(Model==null)
        {
            <tr>
                <td>姓名:<input type="text" name="name"/></td>
            </tr>
            <tr>
                <td>年龄:<input type="text" name="age"/></td>
            </tr>
        }else
        {
            <tr hidden>
                <td>id:<input type="text" name="id" value="@Model.Id"/></td>
            </tr>
             <tr>
                <td>姓名:<input type="text" name="name" value="@Model.Name"/></td>
            </tr>
            <tr>
                <td>年龄:<input type="text" name="age" value="@Model.Age"/></td>
            </tr>
        }
    </table>
    <button onclick="Save()">保存</button>
    <button onclick="Back()">返回</button>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="~/js/base.js"></script>